<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of rubriqueController
 *
 * @author didile
 */
class QcmController {   
	
	public function __construct() {
		
	}

	public function load() {
		
	}
	
	public function __toString(){
		return '';
	
	}

        public function action_questionQCM($idRubrique, $libelleQuestion, $libelleProp1, $libelleProp2, $libelleProp3, $description, $numRep){           
           $qcm = new Qcm();
           $qcm->addQuestionToQCM($idRubrique, $libelleQuestion, $libelleProp1, $libelleProp2, $libelleProp3, $description, $numRep);
        }
        
       public function action_createJSON($id){
           $data = RestUtils::processRequest();
           $type = $data->getMethod();
         
          
         	
		//LIRE
		/*$albumsdb = $db->albums;
		$cursor = $albumsdb->find();
	
		$albums = array();
		
		while($cursor->hasNext()) {
			$albums[] = ($cursor->getNext());
		}*/
		
           if($type == 'get'){
                $qcm = new Qcm($id);
		RestUtils::sendResponse(200, json_encode( $qcm->qcmQuestionsArray), 'application/json');
           }
	}
       
	
}

?>
